package com.example.myapplication.http.api

import com.google.gson.annotations.SerializedName
import com.hjq.http.config.IRequestApi


/**
 *    author :
 *    github : https://github.com/getActivity/AndroidProject-Kotlin
 *    time   : 2019/12/07
 *    desc   : 用户登录
 */
class LoginApi : IRequestApi {

    override fun getApi(): String {
        return "barScan"
    }

    private var map = HashMap<String, String>()

    fun setMap(map: HashMap<String, String>): LoginApi = apply {
        this.map = map
    }

    class Bean(
        val Data: DataBean,
        val RESULT: String
    ) {

        data class DataBean(
            val CANLOGIN: String,
            val CKEY: String,
            val EMPLOYEE_INFO: EMPLOYEEINFO,
            val I_DATE: Long,
            val RESULT: String,
            val table: List<Table>
        )

        data class EMPLOYEEINFO(
            val BRANCHCOMPANY: String,
            val COMPANYNAME: String,
            val EMPLOYEENAME: String,
            val EMPLOYEENO: String,
            val ISONLINE: String,
            val InStoreScanPass: String,
            val IsManager: String,
            val IsOneScanPass: String,
            val LEVELCODE: String,
            val Nfcid: String,
            val OutStoreScanPass: String,
            val ROLENAME: String,
            @SerializedName("barcode_input.length")
            val barcode_input: String
        )

        data class Table(
            val CODE: String,
            val FN_ID: String,
            val FN_IDX: String,
            val FN_NAME: String,
            val FN_PARENT_ID: String,
            val FN_TYPE: String
        )
    }

}